package org.snia.exception;

/**
 * 缓存处理异常类
 * 
 * @author c90003207
 * 
 */
public class CacheException extends BusinessException {

	private static final long serialVersionUID = -1213814304328018204L;

	/** 错误代码,默认为未知错误 */
	protected String errorCode = "UNKNOW_ERROR";

	/** 原始异常 */
	protected Throwable ex = null;

	/** 兼容纯错误信息，不含error code,errorArgs的情况 */
	protected String errorMessage = null;

	// 构造函数
	public CacheException() {
		super();
	}

	public CacheException(String msg) {
		super(msg);
		this.errorMessage = msg;
	}

	public CacheException(String msg, Throwable cause) {
//		super(msg, cause);
		this.errorMessage = msg;
		this.ex = cause;
	}

	// getter、setter
	@Override
	public String getErrorCode() {
		return errorCode;
	}

	@Override
	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	public Throwable getEx() {
		return ex;
	}

	public void setEx(Throwable ex) {
		this.ex = ex;
	}

	@Override
	public String getErrorMessage() {
		return errorMessage;
	}

	@Override
	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

}
